'use strict';
function curry(arg) {

  console.log(arg);

  return function (arg1) {
    console.log(arg1);

    return function (arg2) {
      console.log(arg2);
    };
  };
}

curry('curry0')('curry1')('curry2');

// the same as
var curry0 = curry('curry0');
var curry1 = curry0('curry1');
curry1('curry2');